package com.it.dbflow;

import android.app.Application;
import android.os.Environment;

import com.raizlabs.android.dbflow.config.DatabaseConfig;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;

import java.io.File;

public class MyApp extends Application {
  public static   String filename;
  @Override
  public void onCreate() {
    super.onCreate();
//    FlowManager.init(this);

     filename= Environment.getExternalStorageDirectory()+ File.separator;//自定义点半dbflow数据库路径
//    FlowManager.init(this);
    FlowManager.init(FlowConfig.builder(this)
            .addDatabaseConfig(DatabaseConfig.builder(AppDatabase.class)
                    .databaseName(filename+AppDatabase.DB_NAME)
                    .build())
            .build());

  }


  /*@Override
  public File getDatabasePath(String name) {
    File f=new File(filename+name);
    f.mkdirs();

    return f;
  }*/
}